class dict_dot_notation(dict):
    """ 这是将字典转换为点表示法的类 """
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.__dict__ = self

if __name__ == '__main__':
    d = dict_dot_notation({'a': 1, 'b': 2})
    print(d.a)
    print(d.b)
    d.c = 3
    print(d.c)